{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from tvtk.tools import tvtk_doc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "tvtk_doc.main()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from tvtk.api import tvtk\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "s=tvtk.CubeSource(x_length=1.0,y_length=2.0,z_length=3.0)\n",
    "\n",
    "s1=tvtk.ConeSource(radius=1.0,height=2.0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "vtkCubeSource (00000219322C1840)\n",
      "  Debug: Off\n",
      "  Modified Time: 1912144\n",
      "  Reference Count: 2\n",
      "  Registered Events: \n",
      "    Registered Observers:\n",
      "      vtkObserver (00000219325F1410)\n",
      "        Event: 33\n",
      "        EventName: ModifiedEvent\n",
      "        Command: 000002192F022A10\n",
      "        Priority: 0\n",
      "        Tag: 1\n",
      "  Executive: 000002192F01CBE0\n",
      "  ErrorCode: No error\n",
      "  Information: 000002192F2B9C30\n",
      "  AbortExecute: Off\n",
      "  Progress: 0\n",
      "  Progress Text: (None)\n",
      "  X Length: 1\n",
      "  Y Length: 2\n",
      "  Z Length: 3\n",
      "  Center: (0, 0, 0)\n",
      "  Output Points Precision: 0\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "#print(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "m=tvtk.PolyDataMapper(input_connection=s1.output_port)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "a=tvtk.Actor(mapper=m)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "w=tvtk.RenderWindow(size=(300,350))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "r=tvtk.Renderer(background=(0,0,0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "r.add_actor(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "w.add_renderer(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "i=tvtk.RenderWindowInteractor(render_window=w)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "i.initialize()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "i.start()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "dvenv",
   "language": "python",
   "name": "dvenv"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6rc1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
